﻿using Shop.Models;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shop.BLL
{
    /// <summary>
    /// 规格
    /// </summary>
    public class InfoManager:BaseManager<ProductInfo>
    {
        /// <summary>
        /// 根据商品id获取商品的规格列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List<ProductInfo> GetListByPId(int id)
        {
            string where = "productid=@pid";
            var sp = new SqlParameter[]
            {
                new SqlParameter("@pid",id)
            };
            try
            {
                return service.GetList(where, sp);
            }
            catch
            {
                throw;
            }
        }
    }
}
